<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<head th:replace="admin::head"></head>
<title>动漫资源爬取 - 管理员中心 - 双辞动漫-专注二次元动漫的小站</title>
<meta name="keywords" content="播放资源爬取 - 管理员中心">
<meta name="description" content="播放资源爬取 - 管理员中心">
<link rel="stylesheet" type="text/css" href="css/admin_info.css">
<script type="text/javascript" src="/template/conch/asset/js/set/formValidator.js"></script>
<script type="text/javascript" src="/static/js/jquery.imageupload.js"></script>
<script type="text/javascript">
    var maccms={"path":"","mid":"6","url":"www.scdmfun.cn","wapurl":"www.cdmfun.cn","mob_status":"0"};
    var conchtpl={"surl":"/search.html","tipt":"网站公告","tipc":"这里是双辞动漫新站<br><span class='hl-text-conch'>注意事项：</span>1.老站新老站账号不通用<br>老站网址：<span class='hl-text-conch'>dm.scdmfun.cn</span><br>2.如果登录后还是提示未登录请稍等一会再刷新即可<br>动漫闲聊群：<span class='hl-text-conch'>542266218</span>","slink":"https://www.scdmfun.cn/","short":"","api":"0","tok":"","term":"long-term","ver":"3.1"}
</script>
<body id="conch-member">
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="admin::.conch-header"></div>
<div class="conch-header">
    <div class="conch-headwrap conch-hasone conch-hasconch hl-hide-sm">
        <div class="hl-mob-nav">
            <a href="javascript:MAC.GoBack()" class="hl-pull-left left"><i class="iconfont hl-icon-jiantouzuo"></i></a>
            <a href="javascript:void(0)" class="hl-pull-right right"></a>
            <span class="hl-mob-title hl-text-site hl-lc-1">播放资源修改</span>
        </div>
    </div>
</div>
<div class="conch-content conch-member">
    <div class="conch-ctwrap">
        <div class="hl-ctwrap-item">
            <div class="container">
                <div class="hl-row-box clearfix">
                    <div class="row">
                        <div th:replace="admin::#left"></div>
                        <div id="right" class="hl-right-content hl-col-xs-12 hl-col-sm-70w hl-col-lg-9">
                            <div class="hl-cont-right">
                                <div class="hl-rb-head hl-hidden-xs clearfix">
                                    <h2 class="hl-rb-title">动漫资源爬取</h2>
                                </div>
                                <div class="hl-cont-tab" id="app">
                                    <div class="hl-rb-head hl-head-page clearfix">
                                        <div class="hl-rb-title hl-site-tabs hl-site-tits hl-text-site">
                                            <span style="position: absolute;top: 24px;right: 210px;">已耗时：</span>
                                            <Timer ref="startTimer" style="position: absolute;top: 25px;right: 130px;"></Timer>
                                            <button class="hl-btn-submit hl-bg-conch" style="width: 90px;height: 43px;display: inline;position: absolute;top: -6px;right: 360px;" @click="spider">{{state}}</button>
                                        </div>
                                    </div>
                                    <div class="hl-cont-list">
                                        <div class="hl-list-wrap">
                                            <form id="fm" name="fm" method="post" action="">
                                                <p style="margin-bottom: revert">
                                                    <span style="width: 49%;text-align: center">更新数据</span>
                                                    <span style="width: 49%;text-align: center">新增数据</span>
                                                </p>
                                                <p style="margin-bottom: revert">
                                                    <span style="width: 10%">序号</span>
                                                    <span style="width: 40%">动漫名</span>
                                                    <span style="width: 10%">序号</span>
                                                    <span style="width: 40%">动漫名</span></p>
                                                <div style="width: 49%;float: left">
                                                    <div v-if="updatemap==null||updatemap.length==0">
                                                        <h2>暂无数据</h2>
                                                    </div>
                                                    <li v-if="updatemap.length>0" v-for="(key,value) in updatemap">
                                                        <span style="width: 20%;margin-left: 0px">{{key}}</span>
                                                        <span style="width: 80%;margin-left: 35px">{{value}}</span>
                                                    </li>
                                                </div>
                                                <div style="width: 49%;float: right">
                                                    <div v-if="addmap==null||addmap.length==0">
                                                        <h2>暂无数据</h2>
                                                    </div>
                                                    <li v-if="addmap.length>0" v-for="(key,value) in addmap">
                                                        <span style="width: 20%;position: relative;left: -7px;">{{key}}</span>
                                                        <span style="width: 80%;margin-left: 30px;">{{value}}</span>
                                                    </li>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--海螺影视主题  https://www.360mb.net/23977.html-->
<div th:replace="admin::.conch-footer"></div>
<script src="https://lib.baomitu.com/vue/2.6.14/vue.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.26.0/axios.min.js"></script>
<script type="text/javascript">
    let a=new Vue({
        el: "#app",
        data: {
            updatemap: [],
            addmap: [],
            state: '开始爬取',
            isrun: false
        },
        methods: {
            async spider(){
                if (this.isrun){
                    alert('正在爬取数据中');
                    return ;
                }
                var url="spiderData.do";
                this.state='爬取中';
                this.start();
                this.isrun=true;
                await axios.get(url).then(res=>{
                    var data=res.data;
                    if (data.code==1){
                        this.updatemap=data.data["updatemap"];
                        this.addmap=data.data["addmap"];
                        alert('爬取完成');
                    }
                });
                this.state='开始爬取';
                this.stop();
                this.isrun=false;
            },
            start(){
                this.$refs.startTimer.start();
            },
            stop(){
                this.$refs.startTimer.stop();
            }
        },
        components: {
            'Timer': httpVueLoader('/vue/time.vue')
        },
    })
</script>
</body>
</html>